package lancs.mobilemedia.core.ui.screens;

import java.util.Vector;

import javax.microedition.lcdui.Command;

public abstract class CommandListDecorator implements CommandList {

	CommandList commandList;

	Vector v;

	public CommandListDecorator(CommandList commandListParam) {
		commandList = commandListParam;
		init();
	}

	public void init() {
		v = new Vector();
	}

	public void addToVector(Command c) {
		v.addElement(c);
	}

	public Vector getList() {
		Vector completeVector = new Vector();
		
		Vector tmp = commandList.getList();
		for (int i = 0; i < commandList.getList().size(); i++) {
			completeVector.addElement(tmp.elementAt(i));
		}
		
		for (int i = 0; i < v.size(); i++) {
			completeVector.addElement(v.elementAt(i));
		}
		return completeVector;
	}
}
